//等比例控制图片
function imgRate(){
	//获取全部图片
	var target = $('body').find('*[data-rate]');
	target.each(function(){
		var node = $(this);
		var nodeWidth = node.width();
		var rate = node.attr('data-rate');
		var reg = /\//g;
		if(rate){
			if(reg.test(rate)){
				//判断是否为分数
				var arr = rate.split("/");
				rate = parseInt(arr[0])/parseInt(arr[1]);
			};
			node.height(nodeWidth/rate);
		};
	});
};

$(window).resize(function(){
	imgRate();
});